home *** CD-ROM | disk | FTP | other *** search
- property holesFilled, dynoBitmap, dynoFlag, holeList, firstHoleChan, dynoAnimChan, sandboxChan
- global gCustomCursor, gRollAnimButton, gLevelObject, gTruckObject, gSimObject
-
- on birth me
- set dynoBitmap to the number of cast "dynamite"
- set holesFilled to 0
- set holeList to [0, 0]
- set firstHoleChan to 1
- set dynoAnimChan to 12
- set sandboxChan to 27
- return me
- end
-
- on setup me
- add(gActorList, birth(script "Rollover Anim Button Class", "goMenu( gDynamiteObject, me )", 27, 27, 5, "RCA-07VO01", "RCA-07RO01"))
- add(gActorList, birth(script "Rollover Anim Button Class", "help( gDynamiteObject, me )", 28, 28, 11, EMPTY, "RCA-05RO02"))
- puppetSprite(dynoAnimChan, 1)
- end
-
- on boxClick me
- if not objectp(gCustomCursor) and (holesFilled < 2) then
- showAllActors()
- hideAllActors()
- birth(script "ColorCursor Class", dynoBitmap)
- add(gActorList, gCustomCursor)
- end if
- end
-
- on plungerClick me
- if holesFilled = 2 then
- puppetSprite(dynoAnimChan, 0)
- go("RocksDone")
- end if
- end
-
- on activeAreaClick me
- if sprite 48 within the clickOn and objectp(gCustomCursor) then
- set whichHole to the clickOn - firstHoleChan + 1
- if getAt(holeList, whichHole) = 0 then
- setAt(holeList, whichHole, 1)
- showAllActors()
- set holesFilled to holesFilled + 1
- set the locH of sprite dynoAnimChan to the locH of sprite 48
- set the locV of sprite dynoAnimChan to the locV of sprite 48
- set the castNum of sprite dynoAnimChan to the castNum of sprite 48
- dispose(gCustomCursor)
- updateStage()
- animateSprite(dynoAnimChan, point(the locH of sprite the clickOn, the locV of sprite dynoAnimChan), 1)
- animateSprite(dynoAnimChan, point(the locH of sprite the clickOn, 440), 1)
- if holesFilled = 2 then
- unLoadCast()
- preLoad(label("RocksDone"), label("LastRock"))
- end if
- end if
- end if
- end
-
- on frameDelay me
- startTimer()
- repeat while the timer < 60
- end repeat
- end
-
- on globalButtonClick me
- if objectp(gCustomCursor) then
- showAllActors()
- dispose(gCustomCursor)
- else
- if objectp(gRollAnimButton) then
- click(gRollAnimButton)
- end if
- end if
- end
-
- on finishedGame me
- frameDelay(me)
- set the tileNum of the blockedCellObj of gTruckObject to 0
- set the tileType of the blockedCellObj of gTruckObject to #BG
- set x to blockCrossings(the cell of gTruckObject, getLast(the recordedMoveList of gSimObject))
- reset(me)
- clearAllActors()
- keepSandboxBut(sandboxChan)
- puppetPalette("DynoPal")
- go("Grass")
- go(the frame + 1)
- puppetSprite(48, 0)
- puppetPalette("SimPal", 60)
- updateStage()
- puppetPalette(0)
- predrawSimButtons(gSimObject)
- go(label("Simulator" & string(the level of gLevelObject)))
- end
-
- on reset me
- set holesFilled to 0
- set holeList to [0, 0]
- end
-
- on goMenu me, buttonObject
- forgetObstacle(gSimObject)
- reset(me)
- clearAllActors()
- unpuppetAll()
- makeButtonJump(buttonObject)
- puppetSprite(48, 0)
- puppetPalette("DynoPal")
- go("Grass")
- go(the frame + 1)
- unLoadCast()
- goLocationMap()
- end
-
- on help me, buttonObject
- birth(script "Help Parent", buttonObject, #Dynamite)
- end
-